#pragma once

#include <vector>

#include "node.h"
#include "token.h"
#include "SelectStatement.h"

// used for yyparse()

class ParserContext
{
public:
    ParserContext(const std::vector<Token> * tokens)
       : _tokens(tokens), _tokens_cursor(tokens->begin())
    {
    }

    const Token * NextToken()
    {
        return (_tokens_cursor != _tokens->end()) ? &(*_tokens_cursor++) : 0;
    }

    void AddStatement(const Statement * statement)
    {
        Statements.push_back(statement);
    }

    std::vector<const Statement *> Statements;

private:
    const std::vector<Token> * _tokens;
    std::vector<Token>::const_iterator _tokens_cursor;
};